﻿<Control x:Class="UColor.WPF.SliderControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:local="clr-namespace:UColor.WPF">
    <Control.Template>
        <ControlTemplate TargetType="{x:Type local:SliderControl}">
            <StackPanel>
                <StackPanel Margin="0,0,0,4" Orientation="Horizontal">
                    <TextBlock Text="{TemplateBinding Header}" />
                    <TextBlock Text=":" Margin="2,0,0,0" />
                </StackPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <dxe:TrackBarEdit MinWidth="50"
                                  Grid.Column="0"
                                  Margin="0,0,2,0"
                                  x:Name="trackBarEdit"
                                  SmallStep="{Binding Path=SmallStep, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                  LargeStep="{Binding Path=LargeStep, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                  Minimum="{Binding Path=Minimum, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                  Maximum="{Binding Path=Maximum, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                  Value="{Binding Path=EditValue, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
                        <!--BEGIN WPF-->
                        <dxe:TrackBarEdit.TickPlacement>None</dxe:TrackBarEdit.TickPlacement>
                        <!--END WPF-->
                    </dxe:TrackBarEdit>
                    <TextBlock Grid.Column="1" MinWidth="{TemplateBinding ValueMinWidth}" TextAlignment="Right" Margin="4,0,2,0" Text="{Binding ElementName=trackBarEdit, Path=Value}" />
                    <TextBlock Grid.Column="2" Text="{TemplateBinding UOM}" />
                </Grid>
            </StackPanel>
        </ControlTemplate>
    </Control.Template>
</Control>
